package panda.android.notebook.view;

import java.util.ArrayList;
import java.util.List;

public class Path extends android.graphics.Path {

	StrokePath strokePath;

	/**
	 * 存储路径的点
	 * */
	class quadToPoint {
		float x1, y1;
		float x2, y2;

		public void quadTo(float x1, float y1, float x2, float y2) {
			this.x1 = x1;
			this.y1 = y1;
			this.x2 = x2;
			this.y2 = y2;
		}
	}

	class StrokePath {
		List<quadToPoint> points;
		float startX, startY;
		float stopX, stopY;
	}

	@Override
	public void moveTo(float x, float y) {
		// TODO Auto-generated method stub
		super.moveTo(x, y);
		strokePath = new StrokePath();
		strokePath.points = new ArrayList<quadToPoint>();
		strokePath.startX = x;
		strokePath.startY = y;

	}

	@Override
	public void lineTo(float x, float y) {
		// TODO Auto-generated method stub
		super.lineTo(x, y);
		strokePath.stopX = x;
		strokePath.stopY = y;
	}

	@Override
	public void quadTo(float x1, float y1, float x2, float y2) {
		// TODO Auto-generated method stub
		super.quadTo(x1, y1, x2, y2);
		quadToPoint point = new quadToPoint();
		point.quadTo(x1, y1, x2, y2);
		strokePath.points.add(point);
	}
}
